[qemu patches] Update patches upto changeset 13108:ed815cbdc90e.
authorChristian Limpach <Christian.Limpach@xensource.com>
Wed, 20 Dec 2006 15:22:46 +0000 (15:22 +0000)
committerChristian Limpach <Christian.Limpach@xensource.com>
Wed, 20 Dec 2006 15:22:46 +0000 (15:22 +0000)
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
15 files changed:
tools/ioemu/patches/domain-timeoffset
tools/ioemu/patches/fix-interrupt-routing
tools/ioemu/patches/ioemu-ia64
tools/ioemu/patches/qemu-bootorder
tools/ioemu/patches/series
tools/ioemu/patches/tpm-tis-device
tools/ioemu/patches/vnc-display-find-unused
tools/ioemu/patches/vnc-fixes
tools/ioemu/patches/vnc-listen-specific-interface
tools/ioemu/patches/vnc-password
tools/ioemu/patches/vnc-start-vncviewer
tools/ioemu/patches/xen-mapcache
tools/ioemu/patches/xen-support-buffered-ioreqs
tools/ioemu/patches/xenstore-block-device-config
tools/ioemu/patches/xenstore-write-vnc-port

index 45e081381d19f7bd3f111b93e849269e8ef099be..605fa32ed06bde727947b067ab6c35d97ea8060e 100644 (file)
@@ -1,7 +1,7 @@
 Index: ioemu/hw/mc146818rtc.c
 ===================================================================
---- ioemu.orig/hw/mc146818rtc.c        2006-12-08 18:36:31.000000000 +0000
-+++ ioemu/hw/mc146818rtc.c     2006-12-08 18:36:36.000000000 +0000
+--- ioemu.orig/hw/mc146818rtc.c        2006-12-20 15:21:33.000000000 +0000
++++ ioemu/hw/mc146818rtc.c     2006-12-20 15:21:50.000000000 +0000
 @@ -178,10 +178,27 @@
      }
  }
@@ -46,8 +46,8 @@ Index: ioemu/hw/mc146818rtc.c
  static void rtc_copy_date(RTCState *s)
 Index: ioemu/hw/pc.c
 ===================================================================
---- ioemu.orig/hw/pc.c 2006-12-08 18:36:35.000000000 +0000
-+++ ioemu/hw/pc.c      2006-12-08 18:36:36.000000000 +0000
+--- ioemu.orig/hw/pc.c 2006-12-20 15:21:49.000000000 +0000
++++ ioemu/hw/pc.c      2006-12-20 15:21:50.000000000 +0000
 @@ -159,7 +159,7 @@
  }
  
@@ -117,8 +117,8 @@ Index: ioemu/hw/pc.c
  QEMUMachine pc_machine = {
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 18:36:35.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 18:36:36.000000000 +0000
+--- ioemu.orig/vl.c    2006-12-20 15:21:49.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:50.000000000 +0000
 @@ -163,6 +163,8 @@
  
  int xc_handle;
@@ -162,7 +162,7 @@ Index: ioemu/vl.c
              }
          }
      }
-@@ -6492,7 +6500,8 @@
+@@ -6484,7 +6492,8 @@
  
      machine->init(ram_size, vga_ram_size, boot_device,
                    ds, fd_filename, snapshot,
@@ -174,8 +174,8 @@ Index: ioemu/vl.c
      if (usb_enabled) {
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 18:36:35.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 18:36:36.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:21:49.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:50.000000000 +0000
 @@ -576,7 +576,7 @@
                                   int boot_device,
               DisplayState *ds, const char **fd_filename, int snapshot,
index b5d8285398825ed5da198c5683c4a79f9e25bc24..2d27d6247273b50c6ceda660ac9830c615c7c4fc 100644 (file)
@@ -17,23 +17,21 @@ Signed-off-by: Keir Fraser <keir@xensource.com>
 
 Index: ioemu/Makefile.target
 ===================================================================
---- ioemu.orig/Makefile.target 2006-12-08 18:21:56.000000000 +0000
-+++ ioemu/Makefile.target      2006-12-08 18:22:35.000000000 +0000
-@@ -298,7 +298,7 @@
+--- ioemu.orig/Makefile.target 2006-12-20 15:04:55.000000000 +0000
++++ ioemu/Makefile.target      2006-12-20 15:08:16.000000000 +0000
+@@ -296,9 +296,9 @@
+ # qemu-dm objects
  ifeq ($(ARCH),ia64)
- LIBOBJS=helper2.o exec-dm.o i8259-dm.o
+-LIBOBJS=helper2.o exec-dm.o i8259-dm.o
++LIBOBJS=helper2.o exec-dm.o i8259-dm.o piix_pci-dm.o
  else
 -LIBOBJS=helper2.o exec-dm.o i8259-dm.o rtc-dm.o
 +LIBOBJS=helper2.o exec-dm.o i8259-dm.o rtc-dm.o piix_pci-dm.o
  endif
  
  all: $(PROGS)
-@@ -360,11 +360,11 @@
- # Hardware support
- VL_OBJS+= ide.o pckbd.o ps2.o vga.o $(SOUND_HW) dma.o $(AUDIODRV)
- ifeq ($(ARCH),ia64)
--VL_OBJS+= fdc.o mc146818rtc.o serial.o pc.o
-+VL_OBJS+= fdc.o mc146818rtc.o serial.o pc.o piix_pci.o
+@@ -364,7 +364,7 @@
  else
  VL_OBJS+= fdc.o serial.o pc.o
  endif
@@ -44,8 +42,8 @@ Index: ioemu/Makefile.target
  VL_OBJS+= xenstore.o
 Index: ioemu/target-i386-dm/i8259-dm.c
 ===================================================================
---- ioemu.orig/target-i386-dm/i8259-dm.c       2006-12-08 18:21:36.000000000 +0000
-+++ ioemu/target-i386-dm/i8259-dm.c    2006-12-08 18:22:35.000000000 +0000
+--- ioemu.orig/target-i386-dm/i8259-dm.c       2006-12-20 15:04:54.000000000 +0000
++++ ioemu/target-i386-dm/i8259-dm.c    2006-12-20 15:04:55.000000000 +0000
 @@ -33,7 +33,7 @@
  
  void pic_set_irq_new(void *opaque, int irq, int level)
@@ -58,7 +56,7 @@ Index: ioemu/target-i386-dm/i8259-dm.c
 Index: ioemu/target-i386-dm/piix_pci-dm.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/target-i386-dm/piix_pci-dm.c 2006-12-08 18:22:35.000000000 +0000
++++ ioemu/target-i386-dm/piix_pci-dm.c 2006-12-20 15:08:13.000000000 +0000
 @@ -0,0 +1,397 @@
 +/*
 + * QEMU i440FX/PIIX3 PCI Bridge Emulation
index d8afe7fe3cfe6a65553d2ab9b36a4738d984a6f7..863ecbd993057df5115a3b9bb390f8f440570b1d 100644 (file)
@@ -1,7 +1,7 @@
 Index: ioemu/hw/iommu.c
 ===================================================================
---- ioemu.orig/hw/iommu.c      2006-12-08 02:02:07.000000000 +0000
-+++ ioemu/hw/iommu.c   2006-12-08 02:02:34.000000000 +0000
+--- ioemu.orig/hw/iommu.c      2006-12-20 15:04:54.000000000 +0000
++++ ioemu/hw/iommu.c   2006-12-20 15:04:54.000000000 +0000
 @@ -82,7 +82,11 @@
  #define IOPTE_VALID         0x00000002 /* IOPTE is valid */
  #define IOPTE_WAZ           0x00000001 /* Write as zeros */
@@ -16,8 +16,8 @@ Index: ioemu/hw/iommu.c
  
 Index: ioemu/cpu-all.h
 ===================================================================
---- ioemu.orig/cpu-all.h       2006-12-08 02:02:07.000000000 +0000
-+++ ioemu/cpu-all.h    2006-12-08 02:02:34.000000000 +0000
+--- ioemu.orig/cpu-all.h       2006-12-20 15:04:54.000000000 +0000
++++ ioemu/cpu-all.h    2006-12-20 15:04:54.000000000 +0000
 @@ -835,6 +835,31 @@
                  :"=m" (*(volatile long *)addr)
                  :"dIr" (nr));
@@ -52,13 +52,17 @@ Index: ioemu/cpu-all.h
  /* memory API */
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 02:02:28.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 02:02:34.000000000 +0000
-@@ -6137,6 +6137,11 @@
+--- ioemu.orig/vl.c    2006-12-20 15:04:54.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:12:00.000000000 +0000
+@@ -6137,6 +6137,15 @@
              exit(1);
      }
  
 +#if defined (__ia64__)
++    /* ram_size passed from xend has added on GFW memory,
++       so we must subtract it here */
++    ram_size -= 16 * MEM_M;
++
 +    if (ram_size > MMIO_START)
 +        ram_size += 1 * MEM_G; /* skip 3G-4G MMIO, LEGACY_IO_SPACE etc. */
 +#endif
@@ -66,7 +70,7 @@ Index: ioemu/vl.c
      /* init the memory */
      phys_ram_size = ram_size + vga_ram_size + bios_size;
  
-@@ -6161,6 +6166,7 @@
+@@ -6161,6 +6170,7 @@
          exit(-1);
      }
  
@@ -74,41 +78,29 @@ Index: ioemu/vl.c
      for ( i = 0; i < tmp_nr_pages; i++)
          page_array[i] = i;
  
-@@ -6185,6 +6191,48 @@
+@@ -6185,6 +6195,36 @@
  
      free(page_array);
  
 +#elif defined(__ia64__)
 +  
-+    if (xc_ia64_get_pfn_list(xc_handle, domid, page_array,
-+                             IO_PAGE_START >> PAGE_SHIFT, 3) != 3) {
-+        fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
-+        exit(-1);
-+    }
-+
 +    shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
 +                                       PROT_READ|PROT_WRITE,
-+                                       page_array[0]);
-+
-+    fprintf(logfile, "shared page at pfn:%lx, mfn: %016lx\n",
-+            IO_PAGE_START >> PAGE_SHIFT, page_array[0]);
++                                       IO_PAGE_START >> PAGE_SHIFT);
 +
 +    buffered_io_page =xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
 +                                       PROT_READ|PROT_WRITE,
-+                                       page_array[2]);
-+    fprintf(logfile, "Buffered IO page at pfn:%lx, mfn: %016lx\n",
-+            BUFFER_IO_PAGE_START >> PAGE_SHIFT, page_array[2]);
-+
-+    if (xc_ia64_get_pfn_list(xc_handle, domid,
-+                             page_array, 0, nr_pages) != nr_pages) {
-+        fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
-+        exit(-1);
-+    }
++                                       BUFFER_IO_PAGE_START >> PAGE_SHIFT);
 +
++    for (i = 0; i < tmp_nr_pages; i++)
++        page_array[i] = i;
++      
++    /* VTI will not use memory between 3G~4G, so we just pass a legal pfn
++       to make QEMU map continuous virtual memory space */
 +    if (ram_size > MMIO_START) {      
 +        for (i = 0 ; i < (MEM_G >> PAGE_SHIFT); i++)
 +            page_array[(MMIO_START >> PAGE_SHIFT) + i] =
-+                page_array[(IO_PAGE_START >> PAGE_SHIFT) + 1];
++                (STORE_PAGE_START >> PAGE_SHIFT); 
 +    }
 +
 +    phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
@@ -125,8 +117,8 @@ Index: ioemu/vl.c
      phys_ram_base = qemu_vmalloc(phys_ram_size);
 Index: ioemu/exec-all.h
 ===================================================================
---- ioemu.orig/exec-all.h      2006-12-08 02:02:07.000000000 +0000
-+++ ioemu/exec-all.h   2006-12-08 02:02:34.000000000 +0000
+--- ioemu.orig/exec-all.h      2006-12-20 15:04:54.000000000 +0000
++++ ioemu/exec-all.h   2006-12-20 15:04:54.000000000 +0000
 @@ -462,12 +462,13 @@
  }
  #endif
@@ -146,8 +138,8 @@ Index: ioemu/exec-all.h
  
 Index: ioemu/target-i386-dm/cpu.h
 ===================================================================
---- ioemu.orig/target-i386-dm/cpu.h    2006-12-08 02:02:07.000000000 +0000
-+++ ioemu/target-i386-dm/cpu.h 2006-12-08 02:02:34.000000000 +0000
+--- ioemu.orig/target-i386-dm/cpu.h    2006-12-20 15:04:54.000000000 +0000
++++ ioemu/target-i386-dm/cpu.h 2006-12-20 15:10:13.000000000 +0000
 @@ -78,7 +78,11 @@
  /* helper2.c */
  int main_loop(void);
@@ -163,7 +155,7 @@ Index: ioemu/target-i386-dm/cpu.h
 Index: ioemu/ia64_intrinsic.h
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/ia64_intrinsic.h     2006-12-08 02:02:34.000000000 +0000
++++ ioemu/ia64_intrinsic.h     2006-12-20 15:04:54.000000000 +0000
 @@ -0,0 +1,276 @@
 +#ifndef IA64_INTRINSIC_H
 +#define IA64_INTRINSIC_H
index e0142b4313c7b83e5c4f156dc85301086642f18d..c03e6a1c230675c7e32927ce7674118f932afba9 100644 (file)
@@ -1,7 +1,7 @@
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 02:02:38.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 02:02:38.000000000 +0000
+--- ioemu.orig/vl.c    2006-12-20 15:12:08.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:19.000000000 +0000
 @@ -125,7 +125,7 @@
  struct sockaddr_in vnclisten_addr;
  const char* keyboard_layout = NULL;
@@ -17,15 +17,17 @@ Index: ioemu/vl.c
              case QEMU_OPTION_boot:
 -                boot_device = optarg[0];
 -                if (boot_device != 'a' && 
-+                boot_device = strdup(optarg);
-+                if (strspn(boot_device, "acd"
- #ifdef TARGET_SPARC
+-#ifdef TARGET_SPARC
 -                  // Network boot
 -                  boot_device != 'n' &&
-+                           "n"
- #endif
+-#endif
 -                    boot_device != 'c' && boot_device != 'd') {
 -                    fprintf(stderr, "qemu: invalid boot device '%c'\n", boot_device);
++                boot_device = strdup(optarg);
++                if (strspn(boot_device, "acd"
++#if defined(TARGET_SPARC) || defined(TARGET_I386)
++                           "n"
++#endif
 +                        ) != strlen(boot_device)) {
 +                    fprintf(stderr, "qemu: invalid boot device in '%s'\n",
 +                            boot_device);
@@ -48,7 +50,7 @@ Index: ioemu/vl.c
  #endif /* !CONFIG_DM */
  
      setvbuf(stdout, NULL, _IOLBF, 0);
-@@ -6598,6 +6600,7 @@
+@@ -6590,6 +6592,7 @@
                    ds, fd_filename, snapshot,
                    kernel_filename, kernel_cmdline, initrd_filename,
                    timeoffset);
@@ -58,8 +60,8 @@ Index: ioemu/vl.c
      if (usb_enabled) {
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 02:02:38.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 02:02:38.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:12:08.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:14.000000000 +0000
 @@ -578,7 +578,7 @@
  #ifndef QEMU_TOOL
  
@@ -80,9 +82,9 @@ Index: ioemu/vl.h
                            uint32_t initrd_image, uint32_t initrd_size,
 Index: ioemu/hw/pc.c
 ===================================================================
---- ioemu.orig/hw/pc.c 2006-12-08 02:02:38.000000000 +0000
-+++ ioemu/hw/pc.c      2006-12-08 02:02:38.000000000 +0000
-@@ -158,8 +158,23 @@
+--- ioemu.orig/hw/pc.c 2006-12-20 15:12:08.000000000 +0000
++++ ioemu/hw/pc.c      2006-12-20 15:21:19.000000000 +0000
+@@ -158,8 +158,25 @@
      rtc_set_memory(s, info_ofs + 8, sectors);
  }
  
@@ -96,6 +98,8 @@ Index: ioemu/hw/pc.c
 +            return 0x02;            /* hard drive */
 +        case 'd':
 +            return 0x03;            /* cdrom */
++        case 'n':
++            return 0x04;            /* network */
 +        }
 +    }
 +    return 0x00;                /* no device */
@@ -107,7 +111,7 @@ Index: ioemu/hw/pc.c
  {
      RTCState *s = rtc_state;
      int val;
-@@ -205,21 +220,14 @@
+@@ -205,21 +222,14 @@
      rtc_set_memory(s, 0x34, val);
      rtc_set_memory(s, 0x35, val >> 8);
      
@@ -137,7 +141,7 @@ Index: ioemu/hw/pc.c
  
      /* floppy type */
  
-@@ -617,7 +625,7 @@
+@@ -617,7 +627,7 @@
  #define NOBIOS 1
  
  /* PC hardware initialisation */
@@ -146,7 +150,7 @@ Index: ioemu/hw/pc.c
                       DisplayState *ds, const char **fd_filename, int snapshot,
                       const char *kernel_filename, const char *kernel_cmdline,
                       const char *initrd_filename, time_t timeoffset,
-@@ -919,7 +927,7 @@
+@@ -919,7 +929,7 @@
      }
  }
  
@@ -155,7 +159,7 @@ Index: ioemu/hw/pc.c
                          DisplayState *ds, const char **fd_filename, 
                          int snapshot, 
                          const char *kernel_filename, 
-@@ -933,7 +941,7 @@
+@@ -933,7 +943,7 @@
               initrd_filename, timeoffset, 1);
  }
  
index 6d6f1f8ee617dae1a0caeaac244101570b3ac66e..f6022ddf8afc4b7fc9c60c7101d6b3f540e6ff3b 100644 (file)
@@ -67,5 +67,5 @@ usb-uhci-buffer-size
 vnc-monitor-shift-key-processing
 ide-error-reporting
 vnc-numpad-handling
-xen-mapcache -p3
+xen-mapcache
 usb-mouse-tablet-status-check -p3
index f0b4c00858c9648a4ba11c0bed1f65b89551435a..b4bcbaba91496a71950c84be11d36df4033591a5 100644 (file)
@@ -22,8 +22,8 @@ Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
 
 Index: ioemu/Makefile.target
 ===================================================================
---- ioemu.orig/Makefile.target 2006-12-08 18:33:48.000000000 +0000
-+++ ioemu/Makefile.target      2006-12-08 18:35:14.000000000 +0000
+--- ioemu.orig/Makefile.target 2006-12-20 15:21:55.000000000 +0000
++++ ioemu/Makefile.target      2006-12-20 15:21:55.000000000 +0000
 @@ -369,6 +369,7 @@
  VL_OBJS+= piix4acpi.o
  VL_OBJS+= xenstore.o
@@ -34,9 +34,9 @@ Index: ioemu/Makefile.target
  ifeq ($(TARGET_BASE_ARCH), ppc)
 Index: ioemu/hw/pc.c
 ===================================================================
---- ioemu.orig/hw/pc.c 2006-12-08 18:33:47.000000000 +0000
-+++ ioemu/hw/pc.c      2006-12-08 18:33:48.000000000 +0000
-@@ -875,6 +875,9 @@
+--- ioemu.orig/hw/pc.c 2006-12-20 15:21:54.000000000 +0000
++++ ioemu/hw/pc.c      2006-12-20 15:21:55.000000000 +0000
+@@ -877,6 +877,9 @@
          }
      }
  
@@ -49,7 +49,7 @@ Index: ioemu/hw/pc.c
 Index: ioemu/hw/tpm_tis.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/hw/tpm_tis.c 2006-12-08 18:35:25.000000000 +0000
++++ ioemu/hw/tpm_tis.c 2006-12-20 15:21:55.000000000 +0000
 @@ -0,0 +1,1120 @@
 +/*
 + * tpm_tis.c - QEMU emulator for a 1.2 TPM with TIS interface
@@ -1173,8 +1173,8 @@ Index: ioemu/hw/tpm_tis.c
 +}
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 18:33:48.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 18:35:14.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:21:55.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:55.000000000 +0000
 @@ -932,6 +932,10 @@
  void piix4_pm_init(PCIBus *bus, int devfn);
  void acpi_bios_init(void);
index 2f7e5091534e5c96ad9b9268e0cddc8cb0d4143b..cec29ea456e8ca4debda7291293f882bfeceb139 100644 (file)
@@ -1,7 +1,7 @@
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/vnc.c        2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vnc.c   2006-12-20 15:21:52.000000000 +0000
++++ ioemu/vnc.c        2006-12-20 15:21:52.000000000 +0000
 @@ -1197,7 +1197,7 @@
      }
  }
@@ -50,8 +50,8 @@ Index: ioemu/vnc.c
  int vnc_start_viewer(int port)
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vl.c    2006-12-20 15:21:51.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:52.000000000 +0000
 @@ -121,6 +121,7 @@
  static DisplayState display_state;
  int nographic;
@@ -104,7 +104,7 @@ Index: ioemu/vl.c
              }
          }
      }
-@@ -6468,7 +6478,7 @@
+@@ -6460,7 +6470,7 @@
      if (nographic) {
          dumb_display_init(ds);
      } else if (vnc_display != -1) {
@@ -115,8 +115,8 @@ Index: ioemu/vl.c
      } else {
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:21:51.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:52.000000000 +0000
 @@ -785,7 +785,7 @@
  void cocoa_display_init(DisplayState *ds, int full_screen);
  
index 0c847affa095d664fc8dda5a78d111b6294370bd..2a96cc46d512ac5d896dfad4d39d813201175e78 100644 (file)
@@ -1,8 +1,8 @@
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 02:02:36.000000000 +0000
-@@ -6519,8 +6519,10 @@
+--- ioemu.orig/vl.c    2006-12-20 15:21:51.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:51.000000000 +0000
+@@ -6511,8 +6511,10 @@
          }
      }
  
@@ -17,8 +17,8 @@ Index: ioemu/vl.c
      if (use_gdbstub) {
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/vnc.c        2006-12-08 02:02:36.000000000 +0000
+--- ioemu.orig/vnc.c   2006-12-20 15:21:51.000000000 +0000
++++ ioemu/vnc.c        2006-12-20 15:21:51.000000000 +0000
 @@ -3,6 +3,7 @@
   * 
   * Copyright (C) 2006 Anthony Liguori <anthony@codemonkey.ws>
@@ -531,8 +531,8 @@ Index: ioemu/vnc.c
  }
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 02:02:36.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:21:51.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:51.000000000 +0000
 @@ -319,6 +319,7 @@
  int is_graphic_console(void);
  CharDriverState *text_console_init(DisplayState *ds);
index a11a554a522f78260b323a35b33e967c8bb287fb..737547923921ebf53665af29d657000b8aa0ceb6 100644 (file)
@@ -20,8 +20,8 @@ Signed-off-by:  Daniel P. Berrange <berrange@redhat.com>
 
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 02:02:37.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vl.c    2006-12-20 15:21:52.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:52.000000000 +0000
 @@ -122,6 +122,7 @@
  int nographic;
  int vncviewer;
@@ -114,7 +114,7 @@ Index: ioemu/vl.c
              }
          }
      }
-@@ -6478,7 +6493,7 @@
+@@ -6470,7 +6485,7 @@
      if (nographic) {
          dumb_display_init(ds);
      } else if (vnc_display != -1) {
@@ -125,8 +125,8 @@ Index: ioemu/vl.c
      } else {
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 02:02:37.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:21:52.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:52.000000000 +0000
 @@ -37,6 +37,8 @@
  #include <unistd.h>
  #include <fcntl.h>
@@ -147,8 +147,8 @@ Index: ioemu/vl.h
  /* ide.c */
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-12-08 02:02:37.000000000 +0000
-+++ ioemu/vnc.c        2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vnc.c   2006-12-20 15:21:52.000000000 +0000
++++ ioemu/vnc.c        2006-12-20 15:21:52.000000000 +0000
 @@ -1197,9 +1197,8 @@
      }
  }
index 1a923ddfc0092b49ebc6a9c8f3bdd8ffa05a642c..287f9a44eb6a158507c39cf07a2be0d41da4cdd5 100644 (file)
@@ -17,8 +17,8 @@ Signed-off-by: Masami Watanabe <masami.watanabe@jp.fujitsu.com>
 
 Index: ioemu/Makefile.target
 ===================================================================
---- ioemu.orig/Makefile.target 2006-12-08 18:20:53.000000000 +0000
-+++ ioemu/Makefile.target      2006-12-08 18:20:53.000000000 +0000
+--- ioemu.orig/Makefile.target 2006-12-20 15:21:55.000000000 +0000
++++ ioemu/Makefile.target      2006-12-20 15:21:55.000000000 +0000
 @@ -407,6 +407,7 @@
  VL_OBJS+=sdl.o
  endif
@@ -39,8 +39,8 @@ Index: ioemu/Makefile.target
  
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 18:20:52.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 18:20:53.000000000 +0000
+--- ioemu.orig/vl.c    2006-12-20 15:21:54.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:55.000000000 +0000
 @@ -171,6 +171,9 @@
  char domain_name[1024] = { 'H','V', 'M', 'X', 'E', 'N', '-'};
  extern int domid;
@@ -59,7 +59,7 @@ Index: ioemu/vl.c
  #ifndef CONFIG_DM
  #ifdef TARGET_PPC
      cdrom_index = 1;
-@@ -6543,6 +6547,10 @@
+@@ -6535,6 +6539,10 @@
  
      init_ioports();
  
@@ -72,8 +72,8 @@ Index: ioemu/vl.c
          dumb_display_init(ds);
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 18:20:52.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 18:20:53.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:21:54.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:55.000000000 +0000
 @@ -1214,6 +1214,7 @@
  void xenstore_process_event(void *opaque);
  void xenstore_check_new_media_present(int timeout);
@@ -92,8 +92,8 @@ Index: ioemu/vl.h
  #endif /* VL_H */
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-12-08 18:20:52.000000000 +0000
-+++ ioemu/vnc.c        2006-12-08 18:20:53.000000000 +0000
+--- ioemu.orig/vnc.c   2006-12-20 15:21:52.000000000 +0000
++++ ioemu/vnc.c        2006-12-20 15:21:55.000000000 +0000
 @@ -44,6 +44,7 @@
  
  #include "vnc_keysym.h"
@@ -244,8 +244,8 @@ Index: ioemu/vnc.c
 +}
 Index: ioemu/xenstore.c
 ===================================================================
---- ioemu.orig/xenstore.c      2006-12-08 18:20:52.000000000 +0000
-+++ ioemu/xenstore.c   2006-12-08 18:20:53.000000000 +0000
+--- ioemu.orig/xenstore.c      2006-12-20 15:21:54.000000000 +0000
++++ ioemu/xenstore.c   2006-12-20 15:21:55.000000000 +0000
 @@ -213,3 +213,54 @@
      free(portstr);
      free(buf);
@@ -304,7 +304,7 @@ Index: ioemu/xenstore.c
 Index: ioemu/d3des.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/d3des.c      2006-12-08 18:20:53.000000000 +0000
++++ ioemu/d3des.c      2006-12-20 15:21:55.000000000 +0000
 @@ -0,0 +1,434 @@
 +/*
 + * This is D3DES (V5.09) by Richard Outerbridge with the double and
@@ -743,7 +743,7 @@ Index: ioemu/d3des.c
 Index: ioemu/d3des.h
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/d3des.h      2006-12-08 18:20:53.000000000 +0000
++++ ioemu/d3des.h      2006-12-20 15:21:55.000000000 +0000
 @@ -0,0 +1,51 @@
 +/*
 + * This is D3DES (V5.09) by Richard Outerbridge with the double and
index e897b09c022b31adc5c83e1c4ae04bf690b1347e..9e279f4a978dfa1a970aff199f44e60d8910a3e6 100644 (file)
@@ -1,7 +1,7 @@
 Index: ioemu/vnc.c
 ===================================================================
---- ioemu.orig/vnc.c   2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/vnc.c        2006-12-08 02:02:36.000000000 +0000
+--- ioemu.orig/vnc.c   2006-12-20 15:21:51.000000000 +0000
++++ ioemu/vnc.c        2006-12-20 15:21:51.000000000 +0000
 @@ -1189,3 +1189,25 @@
  
      vnc_dpy_resize(vs->ds, 640, 400);
@@ -30,8 +30,8 @@ Index: ioemu/vnc.c
 +}
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 02:02:36.000000000 +0000
+--- ioemu.orig/vl.c    2006-12-20 15:21:51.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:51.000000000 +0000
 @@ -120,6 +120,7 @@
  int bios_size;
  static DisplayState display_state;
@@ -82,7 +82,7 @@ Index: ioemu/vl.c
              }
          }
      }
-@@ -6461,6 +6469,8 @@
+@@ -6453,6 +6461,8 @@
          dumb_display_init(ds);
      } else if (vnc_display != -1) {
        vnc_display_init(ds, vnc_display);
@@ -93,8 +93,8 @@ Index: ioemu/vl.c
          sdl_display_init(ds, full_screen);
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 02:02:36.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:21:51.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:51.000000000 +0000
 @@ -786,6 +786,7 @@
  
  /* vnc.c */
index dc37d662a7f45040b696bf720855720cdc1d85a4..eb2483cf5897763bdd93441ea9291e16864aa856 100644 (file)
@@ -15,83 +15,14 @@ Signed-off-by: Jun Nakajima <jun.nakajima@intel.com>
 Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
 Signed-off-by: Keir Fraser <keir@xensource.com>
 
-diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/target-i386-dm/cpu.h
---- a/tools/ioemu/target-i386-dm/cpu.h Thu Dec 07 10:54:43 2006 +0000
-+++ b/tools/ioemu/target-i386-dm/cpu.h Thu Dec 07 11:12:52 2006 +0000
-@@ -25,7 +25,8 @@
- #ifdef TARGET_X86_64
- #define TARGET_LONG_BITS 64
- #else
--#define TARGET_LONG_BITS 32
-+/* #define TARGET_LONG_BITS 32 */
-+#define TARGET_LONG_BITS 64 /* for Qemu map cache */
- #endif
- /* target supports implicit self modifying code */
-diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/target-i386-dm/exec-dm.c
---- a/tools/ioemu/target-i386-dm/exec-dm.c     Thu Dec 07 10:54:43 2006 +0000
-+++ b/tools/ioemu/target-i386-dm/exec-dm.c     Thu Dec 07 11:12:52 2006 +0000
-@@ -36,6 +36,7 @@
- #include "cpu.h"
- #include "exec-all.h"
-+#include "vl.h"
- //#define DEBUG_TB_INVALIDATE
- //#define DEBUG_FLUSH
-@@ -426,6 +427,12 @@ static inline int paddr_is_ram(target_ph
- #endif
- }
-+#if defined(__i386__) || defined(__x86_64__)
-+#define phys_ram_addr(x) (qemu_map_cache(x))
-+#elif defined(__ia64__)
-+#define phys_ram_addr(x) (phys_ram_base + (x))
-+#endif
-+
- void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, 
-                             int len, int is_write)
- {
-@@ -438,7 +445,7 @@ void cpu_physical_memory_rw(target_phys_
-         l = TARGET_PAGE_SIZE - (addr & ~TARGET_PAGE_MASK); 
-         if (l > len)
-             l = len;
--      
-+
-         io_index = iomem_index(addr);
-         if (is_write) {
-             if (io_index) {
-@@ -460,9 +467,10 @@ void cpu_physical_memory_rw(target_phys_
-                 }
-             } else if (paddr_is_ram(addr)) {
-                 /* Reading from RAM */
--                memcpy(phys_ram_base + addr, buf, l);
-+                ptr = phys_ram_addr(addr);
-+                memcpy(ptr, buf, l);
- #ifdef __ia64__
--                sync_icache((unsigned long)(phys_ram_base + addr), l);
-+                sync_icache(ptr, l);
- #endif 
-             }
-         } else {
-@@ -485,7 +493,8 @@ void cpu_physical_memory_rw(target_phys_
-                 }
-             } else if (paddr_is_ram(addr)) {
-                 /* Reading from RAM */
--                memcpy(buf, phys_ram_base + addr, l);
-+                ptr = phys_ram_addr(addr);
-+                memcpy(buf, ptr, l);
-             } else {
-                 /* Neither RAM nor known MMIO space */
-                 memset(buf, 0xff, len); 
-diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/vl.c
---- a/tools/ioemu/vl.c Thu Dec 07 10:54:43 2006 +0000
-+++ b/tools/ioemu/vl.c Thu Dec 07 11:12:52 2006 +0000
-@@ -5807,6 +5807,92 @@ int set_mm_mapping(int xc_handle, uint32
+Index: ioemu/vl.c
+===================================================================
+--- ioemu.orig/vl.c    2006-12-20 15:12:08.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:13:00.000000000 +0000
+@@ -5808,6 +5808,91 @@
      return 0;
  }
-+
 +#if defined(__i386__) || defined(__x86_64__)
 +static struct map_cache *mapcache_entry;
 +static unsigned long nr_buckets;
@@ -104,8 +35,8 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/vl.c
 +    if (nr_pages < max_pages)
 +        max_pages = nr_pages;
 +
-+    nr_buckets = (max_pages << PAGE_SHIFT) >> MCACHE_BUCKET_SHIFT;
-+
++    nr_buckets   = max_pages + (1UL << (MCACHE_BUCKET_SHIFT - PAGE_SHIFT)) - 1;
++    nr_buckets >>= (MCACHE_BUCKET_SHIFT - PAGE_SHIFT);
 +    fprintf(logfile, "qemu_map_cache_init nr_buckets = %lx\n", nr_buckets);
 +
 +    mapcache_entry = malloc(nr_buckets * sizeof(struct map_cache));
@@ -141,8 +72,7 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/vl.c
 +
 +    entry = &mapcache_entry[address_index % nr_buckets];
 +
-+    if (entry->vaddr_base == NULL || entry->paddr_index != address_index)
-+    { 
++    if (entry->vaddr_base == NULL || entry->paddr_index != address_index) {
 +        /* We need to remap a bucket. */
 +        uint8_t *vaddr_base;
 +        unsigned long pfns[MCACHE_BUCKET_SIZE >> PAGE_SHIFT];
@@ -177,10 +107,11 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/vl.c
 +    return last_address_vaddr + address_offset;
 +}
 +#endif
++
  int main(int argc, char **argv)
  {
-@@ -6130,6 +6216,7 @@ int main(int argc, char **argv)
+ #ifdef CONFIG_GDBSTUB
+@@ -6130,6 +6215,7 @@
                  break;
              case QEMU_OPTION_m:
                  ram_size = atol(optarg) * 1024 * 1024;
@@ -188,90 +119,194 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/vl.c
                  if (ram_size <= 0)
                      help();
  #ifndef CONFIG_DM
-@@ -6400,50 +6487,41 @@ int main(int argc, char **argv)
+@@ -6404,50 +6490,41 @@
          shared_page_nr = nr_pages - 1;
  #endif
  
-+#if defined(__i386__) || defined(__x86_64__)
-+
-+    if ( qemu_map_cache_init(tmp_nr_pages) )
-+    {
-+        fprintf(logfile, "qemu_map_cache_init returned: error %d\n", errno);
-+        exit(-1);
-+    }
-+
-+    shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
-+                                       PROT_READ|PROT_WRITE, shared_page_nr);
-+    if (shared_page == NULL) {
-+        fprintf(logfile, "map shared IO page returned error %d\n", errno);
-+        exit(-1);
-+    }
-+
-+    fprintf(logfile, "shared page at pfn:%lx\n", shared_page_nr);
-+
-+    buffered_io_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
-+                                            PROT_READ|PROT_WRITE,
-+                                            shared_page_nr - 2);
-+    if (buffered_io_page == NULL) {
-+        fprintf(logfile, "map buffered IO page returned error %d\n", errno);
-+        exit(-1);
-+    }
-+
-+    fprintf(logfile, "buffered io page at pfn:%lx\n", shared_page_nr - 2);
-+
-+#elif defined(__ia64__)
-+
-     page_array = (xen_pfn_t *)malloc(tmp_nr_pages * sizeof(xen_pfn_t));
-     if (page_array == NULL) {
-         fprintf(logfile, "malloc returned error %d\n", errno);
-         exit(-1);
-     }
--#if defined(__i386__) || defined(__x86_64__)
+-    page_array = (xen_pfn_t *)malloc(tmp_nr_pages * sizeof(xen_pfn_t));
+-    if (page_array == NULL) {
+-        fprintf(logfile, "malloc returned error %d\n", errno);
+-        exit(-1);
+-    }
+-
+ #if defined(__i386__) || defined(__x86_64__)
 -    for ( i = 0; i < tmp_nr_pages; i++)
 -        page_array[i] = i;
--
 -    phys_ram_base = xc_map_foreign_batch(xc_handle, domid,
 -                                         PROT_READ|PROT_WRITE, page_array,
 -                                         tmp_nr_pages);
 -    if (phys_ram_base == NULL) {
 -        fprintf(logfile, "batch map guest memory returned error %d\n", errno);
--        exit(-1);
--    }
--
--    shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
++    if ( qemu_map_cache_init(tmp_nr_pages) )
++    {
++        fprintf(logfile, "qemu_map_cache_init returned: error %d\n", errno);
+         exit(-1);
+     }
+     shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
 -                                       PROT_READ|PROT_WRITE,
 -                                       page_array[shared_page_nr]);
--    if (shared_page == NULL) {
--        fprintf(logfile, "map shared IO page returned error %d\n", errno);
--        exit(-1);
--    }
--
++                                       PROT_READ|PROT_WRITE, shared_page_nr);
+     if (shared_page == NULL) {
+         fprintf(logfile, "map shared IO page returned error %d\n", errno);
+         exit(-1);
+     }
 -    fprintf(logfile, "shared page at pfn:%lx, mfn: %"PRIx64"\n",
 -            shared_page_nr, (uint64_t)(page_array[shared_page_nr]));
--
--    buffered_io_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
--                                            PROT_READ|PROT_WRITE,
++    fprintf(logfile, "shared page at pfn:%lx\n", shared_page_nr);
+     buffered_io_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
+                                             PROT_READ|PROT_WRITE,
 -                                            page_array[shared_page_nr - 2]);
--    if (buffered_io_page == NULL) {
--        fprintf(logfile, "map buffered IO page returned error %d\n", errno);
--        exit(-1);
--    }
--
++                                            shared_page_nr - 2);
+     if (buffered_io_page == NULL) {
+         fprintf(logfile, "map buffered IO page returned error %d\n", errno);
+         exit(-1);
+     }
 -    fprintf(logfile, "buffered io page at pfn:%lx, mfn: %"PRIx64"\n",
 -            shared_page_nr - 2, (uint64_t)(page_array[shared_page_nr - 2]));
 -
 -    free(page_array);
--
--#elif defined(__ia64__)
++    fprintf(logfile, "buffered io page at pfn:%lx\n", shared_page_nr - 2);
+ #elif defined(__ia64__)
 -  
-     if (xc_ia64_get_pfn_list(xc_handle, domid, page_array,
-                              IO_PAGE_START >> PAGE_SHIFT, 3) != 3) {
-         fprintf(logfile, "xc_ia64_get_pfn_list returned error %d\n", errno);
-diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/vl.h
---- a/tools/ioemu/vl.h Thu Dec 07 10:54:43 2006 +0000
-+++ b/tools/ioemu/vl.h Thu Dec 07 11:12:52 2006 +0000
-@@ -156,6 +156,26 @@ extern void *shared_vram;
++
++    page_array = (xen_pfn_t *)malloc(tmp_nr_pages * sizeof(xen_pfn_t));
++    if (page_array == NULL) {
++        fprintf(logfile, "malloc returned error %d\n", errno);
++        exit(-1);
++    }
++
+     shared_page = xc_map_foreign_range(xc_handle, domid, PAGE_SIZE,
+                                        PROT_READ|PROT_WRITE,
+                                        IO_PAGE_START >> PAGE_SHIFT);
+Index: ioemu/target-i386-dm/exec-dm.c
+===================================================================
+--- ioemu.orig/target-i386-dm/exec-dm.c        2006-12-20 15:10:13.000000000 +0000
++++ ioemu/target-i386-dm/exec-dm.c     2006-12-20 15:12:13.000000000 +0000
+@@ -36,6 +36,7 @@
+ #include "cpu.h"
+ #include "exec-all.h"
++#include "vl.h"
+ //#define DEBUG_TB_INVALIDATE
+ //#define DEBUG_FLUSH
+@@ -127,10 +128,28 @@
+ FILE *logfile;
+ int loglevel;
++
++#if defined(__i386__) || defined(__x86_64__)
++#define MAPCACHE
++#endif
++
++#ifdef MAPCACHE
++static pthread_mutex_t mapcache_mutex;
++#define mapcache_lock() pthread_mutex_lock(&mapcache_mutex)
++#define mapcache_unlock() pthread_mutex_unlock(&mapcache_mutex)
++#else 
++#define mapcache_lock() ( (void)0 )
++#define mapcache_unlock() ( (void)0 )
++#endif
++
++
+ void cpu_exec_init(CPUState *env)
+ {
+     CPUState **penv;
+     int cpu_index;
++#ifdef MAPCACHE
++    pthread_mutexattr_t mxattr; 
++#endif
+     env->next_cpu = NULL;
+     penv = &first_cpu;
+@@ -144,6 +163,14 @@
+     /* alloc dirty bits array */
+     phys_ram_dirty = qemu_malloc(phys_ram_size >> TARGET_PAGE_BITS);
++
++#ifdef MAPCACHE
++    /* setup memory access mutex to protect mapcache */
++    pthread_mutexattr_init(&mxattr); 
++    pthread_mutexattr_settype(&mxattr, PTHREAD_MUTEX_RECURSIVE);
++    pthread_mutex_init(&mapcache_mutex, &mxattr); 
++    pthread_mutexattr_destroy(&mxattr); 
++#endif
+ }
+ /* enable or disable low levels log */
+@@ -426,19 +453,27 @@
+ #endif
+ }
++#if defined(__i386__) || defined(__x86_64__)
++#define phys_ram_addr(x) (qemu_map_cache(x))
++#elif defined(__ia64__)
++#define phys_ram_addr(x) (phys_ram_base + (x))
++#endif
++
+ void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, 
+                             int len, int is_write)
+ {
+     int l, io_index;
+     uint8_t *ptr;
+     uint32_t val;
+-    
++
++    mapcache_lock();
++
+     while (len > 0) {
+         /* How much can we copy before the next page boundary? */
+         l = TARGET_PAGE_SIZE - (addr & ~TARGET_PAGE_MASK); 
+         if (l > len)
+             l = len;
+-      
++
+         io_index = iomem_index(addr);
+         if (is_write) {
+             if (io_index) {
+@@ -460,9 +495,10 @@
+                 }
+             } else if (paddr_is_ram(addr)) {
+                 /* Reading from RAM */
+-                memcpy(phys_ram_base + addr, buf, l);
++                ptr = phys_ram_addr(addr);
++                memcpy(ptr, buf, l);
+ #ifdef __ia64__
+-                sync_icache((unsigned long)(phys_ram_base + addr), l);
++                sync_icache(ptr, l);
+ #endif 
+             }
+         } else {
+@@ -485,7 +521,8 @@
+                 }
+             } else if (paddr_is_ram(addr)) {
+                 /* Reading from RAM */
+-                memcpy(buf, phys_ram_base + addr, l);
++                ptr = phys_ram_addr(addr);
++                memcpy(buf, ptr, l);
+             } else {
+                 /* Neither RAM nor known MMIO space */
+                 memset(buf, 0xff, len); 
+@@ -495,6 +532,8 @@
+         buf += l;
+         addr += l;
+     }
++
++    mapcache_unlock();
+ }
+ #endif
+Index: ioemu/vl.h
+===================================================================
+--- ioemu.orig/vl.h    2006-12-20 15:12:08.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:12:13.000000000 +0000
+@@ -156,6 +156,26 @@
  
  extern FILE *logfile;
  
@@ -298,3 +333,17 @@ diff -r 3f0ca90351e2 -r 67a06a9b7b1d tools/ioemu/vl.h
  extern int xc_handle;
  extern int domid;
  
+Index: ioemu/target-i386-dm/cpu.h
+===================================================================
+--- ioemu.orig/target-i386-dm/cpu.h    2006-12-20 15:10:13.000000000 +0000
++++ ioemu/target-i386-dm/cpu.h 2006-12-20 15:12:13.000000000 +0000
+@@ -25,7 +25,8 @@
+ #ifdef TARGET_X86_64
+ #define TARGET_LONG_BITS 64
+ #else
+-#define TARGET_LONG_BITS 32
++/* #define TARGET_LONG_BITS 32 */
++#define TARGET_LONG_BITS 64 /* for Qemu map cache */
+ #endif
+ /* target supports implicit self modifying code */
index 10d2a9a84a611933ebfd937ec4b9946953c03653..5a0242c4bda37f7c5b123d8109c90132f479a47d 100644 (file)
@@ -1,7 +1,7 @@
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 02:02:37.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vl.c    2006-12-20 15:21:54.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:54.000000000 +0000
 @@ -5838,6 +5838,7 @@
      unsigned long nr_pages, tmp_nr_pages, shared_page_nr;
      xen_pfn_t *page_array;
@@ -10,7 +10,7 @@ Index: ioemu/vl.c
  
      char qemu_dm_logfilename[64];
  
-@@ -6418,6 +6419,17 @@
+@@ -6422,6 +6423,17 @@
      fprintf(logfile, "shared page at pfn:%lx, mfn: %"PRIx64"\n",
              shared_page_nr, (uint64_t)(page_array[shared_page_nr]));
  
@@ -30,8 +30,8 @@ Index: ioemu/vl.c
  #elif defined(__ia64__)
 Index: ioemu/target-i386-dm/helper2.c
 ===================================================================
---- ioemu.orig/target-i386-dm/helper2.c        2006-12-08 02:02:35.000000000 +0000
-+++ ioemu/target-i386-dm/helper2.c     2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/target-i386-dm/helper2.c        2006-12-20 15:21:47.000000000 +0000
++++ ioemu/target-i386-dm/helper2.c     2006-12-20 15:21:54.000000000 +0000
 @@ -76,6 +76,10 @@
  
  shared_iopage_t *shared_page = NULL;
index 5944e3b45feb2d1f8f32933d151c6f240a35f16d..3ac28fd10feba0f12da71182701d6bdc0262b00f 100644 (file)
@@ -1,7 +1,7 @@
 Index: ioemu/Makefile.target
 ===================================================================
---- ioemu.orig/Makefile.target 2006-12-08 02:02:36.000000000 +0000
-+++ ioemu/Makefile.target      2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/Makefile.target 2006-12-20 15:21:51.000000000 +0000
++++ ioemu/Makefile.target      2006-12-20 15:21:53.000000000 +0000
 @@ -359,6 +359,7 @@
  VL_OBJS+= cirrus_vga.o mixeng.o parallel.o acpi.o piix_pci.o
  VL_OBJS+= usb-uhci.o
@@ -13,7 +13,7 @@ Index: ioemu/Makefile.target
 Index: ioemu/xenstore.c
 ===================================================================
 --- /dev/null  1970-01-01 00:00:00.000000000 +0000
-+++ ioemu/xenstore.c   2006-12-08 02:02:37.000000000 +0000
++++ ioemu/xenstore.c   2006-12-20 15:21:53.000000000 +0000
 @@ -0,0 +1,187 @@
 +/*
 + * This file is subject to the terms and conditions of the GNU General
@@ -204,8 +204,8 @@ Index: ioemu/xenstore.c
 +}
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 02:02:37.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vl.c    2006-12-20 15:21:52.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:53.000000000 +0000
 @@ -5256,9 +5256,11 @@
             "Standard options:\n"
             "-M machine      select emulated machine (-M ? for list)\n"
@@ -359,7 +359,7 @@ Index: ioemu/vl.c
  
      setvbuf(stdout, NULL, _IOLBF, 0);
      
-@@ -6441,6 +6472,7 @@
+@@ -6433,6 +6464,7 @@
  
  #endif /* !CONFIG_DM */
  
@@ -367,7 +367,7 @@ Index: ioemu/vl.c
      /* we always create the cdrom drive, even if no disk is there */
      bdrv_init();
      if (cdrom_index >= 0) {
-@@ -6467,6 +6499,7 @@
+@@ -6459,6 +6491,7 @@
              }
          }
      }
@@ -375,7 +375,7 @@ Index: ioemu/vl.c
  
      /* we always create at least one floppy disk */
      fd_table[0] = bdrv_new("fda");
-@@ -6545,6 +6578,8 @@
+@@ -6537,6 +6570,8 @@
          }
      }
  
@@ -386,8 +386,8 @@ Index: ioemu/vl.c
                    kernel_filename, kernel_cmdline, initrd_filename,
 Index: ioemu/monitor.c
 ===================================================================
---- ioemu.orig/monitor.c       2006-12-08 02:02:35.000000000 +0000
-+++ ioemu/monitor.c    2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/monitor.c       2006-12-20 15:21:47.000000000 +0000
++++ ioemu/monitor.c    2006-12-20 15:21:53.000000000 +0000
 @@ -24,6 +24,7 @@
  #include "vl.h"
  #include "disas.h"
@@ -416,8 +416,8 @@ Index: ioemu/monitor.c
      int i;
 Index: ioemu/block.c
 ===================================================================
---- ioemu.orig/block.c 2006-12-08 02:02:06.000000000 +0000
-+++ ioemu/block.c      2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/block.c 2006-12-20 15:21:31.000000000 +0000
++++ ioemu/block.c      2006-12-20 15:21:53.000000000 +0000
 @@ -758,6 +758,7 @@
  static void raw_close(BlockDriverState *bs)
  {
@@ -428,8 +428,8 @@ Index: ioemu/block.c
  
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 02:02:37.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:21:52.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:53.000000000 +0000
 @@ -1191,6 +1191,8 @@
  void term_print_help(void);
  void monitor_readline(const char *prompt, int is_password,
@@ -455,8 +455,8 @@ Index: ioemu/vl.h
  extern char domain_name[];
 Index: ioemu/hw/ide.c
 ===================================================================
---- ioemu.orig/hw/ide.c        2006-12-08 02:02:35.000000000 +0000
-+++ ioemu/hw/ide.c     2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/hw/ide.c        2006-12-20 15:21:49.000000000 +0000
++++ ioemu/hw/ide.c     2006-12-20 15:21:53.000000000 +0000
 @@ -1158,6 +1158,7 @@
          } else {
              ide_atapi_cmd_error(s, SENSE_NOT_READY, 
index 259d6451f35c5d776429f1a0c2ed86b00bf69c53..725ccc70c062ea64f715d0cdaba747d72fe1db7c 100644 (file)
@@ -1,7 +1,7 @@
 Index: ioemu/xenstore.c
 ===================================================================
---- ioemu.orig/xenstore.c      2006-12-08 02:02:37.000000000 +0000
-+++ ioemu/xenstore.c   2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/xenstore.c      2006-12-20 15:21:53.000000000 +0000
++++ ioemu/xenstore.c   2006-12-20 15:21:54.000000000 +0000
 @@ -185,3 +185,31 @@
      free(image);
      free(vec);
@@ -36,9 +36,9 @@ Index: ioemu/xenstore.c
 +}
 Index: ioemu/vl.c
 ===================================================================
---- ioemu.orig/vl.c    2006-12-08 02:02:37.000000000 +0000
-+++ ioemu/vl.c 2006-12-08 02:02:37.000000000 +0000
-@@ -6535,6 +6535,7 @@
+--- ioemu.orig/vl.c    2006-12-20 15:21:53.000000000 +0000
++++ ioemu/vl.c 2006-12-20 15:21:54.000000000 +0000
+@@ -6527,6 +6527,7 @@
        vnc_display = vnc_display_init(ds, vnc_display, vncunused, &vnclisten_addr);
        if (vncviewer)
            vnc_start_viewer(vnc_display);
@@ -48,8 +48,8 @@ Index: ioemu/vl.c
          sdl_display_init(ds, full_screen);
 Index: ioemu/vl.h
 ===================================================================
---- ioemu.orig/vl.h    2006-12-08 02:02:37.000000000 +0000
-+++ ioemu/vl.h 2006-12-08 02:02:37.000000000 +0000
+--- ioemu.orig/vl.h    2006-12-20 15:21:53.000000000 +0000
++++ ioemu/vl.h 2006-12-20 15:21:54.000000000 +0000
 @@ -1210,6 +1210,7 @@
  int xenstore_fd(void);
  void xenstore_process_event(void *opaque);